<template>
  <div class="toorderdetail">
    <van-nav-bar
      title="标题"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
    />
    <div class="lists-info">
        <p>收货人姓名：{{data.receiver}}</p>
        <p>收货人地址：{{data.regions}}</p>
        <p>下单时间：{{data.updatedAt}}</p>
        <p>价格:￥{{data.price}}</p>
      </div>
  </div>
</template>

<script>
import { Toast } from "vant";
import { reqgetorderoneapi } from "../../api/order";
export default {
  data() {
    return {
        data:{},
    };
  },
  computed: {},
  watch: {},

  methods: {
    //返回上一页
    onClickLeft() {
      Toast("返回");
      this.$router.go(-1);
    },
    // 获取订单页详情
    async getorderone(id){
        const result=await reqgetorderoneapi(id);
        console.log(result);
        this.data=result.order
    }
  },
  created() {
      const id=this.$route.params.id;
      console.log(id);
      this.getorderone(id);
  },
  mounted() {},
  components: {},
};
</script>
<style scoped></style>
